package edu.osu.cse551;

import android.content.Context;
import android.location.Location;
import android.location.LocationListener;
import android.os.Bundle;
import android.widget.Toast;

public class MyLocationListener implements LocationListener {
	private Context contactsAppContext;

	public MyLocationListener(Context appContext) {
		contactsAppContext = appContext;
	}

	@Override
	public void onLocationChanged(Location loc) {
		loc.getLatitude();
		loc.getLongitude();
		String Text = "My current location is: " + "Latitud = "
				+ loc.getLatitude() + "Longitud = " + loc.getLongitude();
		Toast.makeText(contactsAppContext, Text, Toast.LENGTH_SHORT).show();

	}

	@Override
	public void onProviderDisabled(String provider)

	{
		Toast.makeText(contactsAppContext,"GPS Disabled",Toast.LENGTH_SHORT ).show();
	}

	@Override
	public void onProviderEnabled(String provider) {
		Toast.makeText(contactsAppContext,"GPS Enabled",Toast.LENGTH_SHORT).show();
	}

	@Override
	public void onStatusChanged(String provider, int status, Bundle extras) {
	}

}